package com.oigx.lookmu.core;

import java.awt.*;
import java.net.URI;

public class LookMuUtil {

    public static void openWebpage(String url) {
        if (Desktop.isDesktopSupported()) {
            Desktop desktop = Desktop.getDesktop();
            try {
                desktop.browse(new URI(url));
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            Runtime runtime = Runtime.getRuntime();
            try {
                runtime.exec("xdg-open " + url); // For Ubuntu, Fedora, and other Linux distributions
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

}
